-
Notifications
You must be signed in to change notification settings - Fork 1
fix: resolve mypy typing issues in blob.py #103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add proper imports for Optional and Response types - Fix file.filename null check to handle None values - Add return type annotations for methods - Remove type ignore comment by properly typing ResponseArtifact - Improve type annotations using Optional instead of union syntax Co-authored-by: Yusuf Ali <drgroot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes mypy typing issues in the blob.py file by adding proper type annotations and imports. The changes improve type safety and remove the need for type ignore comments.
Key changes:
- Added proper imports for Optional and Response types from typing and flask modules
- Added return type annotations to functions and methods
- Improved null safety by checking file.filename for None values
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| servc/svc/com/http/blob.py | Added type imports, return type annotations, and null safety check for file.filename |
| .github/workflows/claude.yml | Added allowed_tools configuration for the workflow |
| return self._uploadcontainer, secure_filename(fname) | ||
|
|
||
| def _postMessage(self, extra_params: Dict | None = None): | ||
| def _postMessage(self, extra_params: Optional[Dict] = None): |
Copilot
AI
Jul 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Dict type annotation is incomplete. It should specify the key and value types, e.g., Optional[Dict[str, Any]] or Optional[Dict[Any, Any]] for better type safety.
| def _postMessage(self, extra_params: Optional[Dict] = None): | |
| def _postMessage(self, extra_params: Optional[Dict[str, Any]] = None): |
|
|
||
| for filekey in list(request.files): | ||
| file = request.files[filekey] | ||
| if file.filename is None: |
Copilot
AI
Jul 31, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider also checking if file.filename is an empty string, as secure_filename('') could still cause issues. The check should be if not file.filename: to handle both None and empty string cases.
| if file.filename is None: | |
| if not file.filename: |
Fixes typing issues in blob.py identified by mypy --check-untyped-defs
Closes #102
Generated with Claude Code